package com.csnf.service;

import com.csnf.dao.RoleDao2;
import com.csnf.entity.Role;
import com.csnf.util.MybatisUtil;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

public class RoleService {
    RoleDao2 roleDao;//接口不能直接new

    public List<Role> getRole(){

        roleDao= MybatisUtil.init().getMapper(RoleDao2.class);
        List<Role> roleList= roleDao.getRole();
        MybatisUtil.close();
        return roleList;
    }
}
